package org.example;

public class Test3 {
    //leetcode 70 爬楼梯 https://leetcode.cn/problems/climbing-stairs/description/
    public int climbStairs(int n) {
        int prev1 = 0, prev2 = 1, ret = 0;
        for (int i = 2; i < n + 2; i++) {
            ret = prev1 + prev2;
            prev1 = prev2;
            prev2 = ret;
        }
        return ret;
    }
}
